#ifndef __USER_I2C_H
#define __USER_I2C_H

#define I2C_FIXED_ADDRESS      0X03   //模块固定地址
#define I2C_MAX_ADDRESS        120 //模块最大地址
#define VERSION                0X10//版本号



#define REG_CHECK_REPLY        (uint8_t)0x55
//模块通用寄存器
#define REG_CHECK               0X0A 
#define REG_VERSION             0X0B
#define REG_LED                 0X0C
#define REG_RESET               0X0D
 
//模块特殊指令
#define REG_WENDU        0X30        
#define REG_SHIDU        0X31
#define REG_GUANGDU      0X32


//模块总寄存器数量
#define ALL_REG_NUMBER 7


#define LED_ON()  HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_RESET)
#define LED_OFF() HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_SET)


void user_I2cInit(void);
void user_I2cOverTimeCheck(void);
uint8_t user_I2cGetTransmitData(uint8_t reg,uint8_t *buf);
void user_I2cExecuteCallBack(uint8_t reg,uint8_t *buf,uint8_t size);

void user_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
void user_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);
#endif

